package top.kaoshanji.ch05.inheritance;

/**
 * 经理类
 * author kaoshanji
 * ^_^
 * create time 2024/11/25 18:10
 */
public class Manager extends Employee {

    // 奖金
    private double bonus;

    public Manager(String name, double salary, int year, int month, int day) {
        super(name, salary, year, month, day);
        bonus = 0;
    }

    // 覆盖超类的方法，定制属于自己的业务
    @Override
    public double getSalary() {
        double baseSalary = super.getSalary();
        return baseSalary + bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }
}
